#!/usr/bin/perl -w
use strict;
use DBI;
#use HTTP::Lite;
use LWP;
use JSON;use Data::Dumper;#my $http = new HTTP::Lite;
#my $req = $http->request('http://www.btis.in/godown/scripts/php/cityroutebackend_ol.php?org=KORAMANGALA&dst=INDIRANAGAR&city=Bangalore') or die "Unable to get document: $!";
 #   die "Request failed ($req): ".$http->status_message()
  #    if $req ne "200";
my $ua = LWP::UserAgent->new;
  $ua->agent("mozilla");
my $req = HTTP::Request->new(GET => 'http://www.btis.in/godown/scripts/php/cityroutebackend_ol.php?org=KORAMANGALA&dst=INDIRANAGAR&city=Bangalore');
   my $res = $ua->request($req);

my $body;
  # Check the outcome of the response
  if ($res->is_success) {
      $body = $res->content;
  }
  else {
      print $res->status_line, "\n";
  }
my $json = new JSON;
my $obj = $json->jsonToObj($body);
my @routes = $obj->{'routelocs'};
foreach my $route(@routes) {
	foreach my $path (@$route) {
		print $path->{"name"}."\n";
	}
}

